<template>
  <div>
    <div id="divs">
      <p style="font-size: 20px"><b>我的持仓</b></p>
    </div>
    <br>
    <template>
      <el-table
          :data="tableData"
          style="width: 53%;border: #b0b0b0 1px solid">
        <el-table-column
            prop="stockName"
            label="股票名称"
            width="120">
        </el-table-column>
        <el-table-column
            prop="stockCode"
            label="股票编码"
            width="120">
        </el-table-column>
        <el-table-column
            prop="volumePrice"
            label="总购买价"
            width="120">
        </el-table-column>
        <el-table-column
            prop="num"
            label="购买数量"
            width="120">
        </el-table-column>
        <el-table-column
            prop="averagePrice"
            label="购买价格/股"
            width="120">
        </el-table-column>
        <el-table-column
            prop="latestPrice"
            label="官方最新价"
            width="120">
        </el-table-column>
        <el-table-column
            prop="percentageChange"
            label="涨幅"
            width="120">
        </el-table-column>
      </el-table>
    </template>
  </div>

</template>

<script>
export default {
  name: "PositionView",
  data() {
    return {
      tableData:[],
    }
  }, methods: {
    list(){
      this.axios.post("/stockservice/position/list").then(res=>{
        this.tableData=res.data.data;
      })
    }
  }, created() {
    this.list();
  }
}
</script>

<style>
#divs {
  position: relative;
  display: flex;
  justify-content: center;
  top: 1px;
  left: 1px;
  height: 50px;
  width: 100px;
}

</style>
